#include<iostream>
using namespace std;
int main()
{
	int n, m, t;
	while(cin >> t)
	{
		while(t--)
		{
			cin >> n >> m;
			int k;
			if(n > m)
			{
				k = n;
				n = m;
				m = k;
			}
			if(m > 2 && n >= 2) cout << "NO" << endl;
			else cout << "YES" << endl;
		}
	}
}
